package com.zb.uniman.algorithmutils;

import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.List;

/**
 * Author:B
 * Description:数组和集合的转换
 */
public class BaseTransformer {

    public static List<Integer> fromarr(int[] arr) {
        ArrayList<Integer> tArrayList = new ArrayList<>();
        for (int i = 1; i <= arr.length; i++) {
            tArrayList.add(arr[i - 1]);
        }
        return tArrayList;
    }

    public static int[] toarr(List<Integer> list) {
        int[] arr = new int[list.size()];
        for (int i = 1; i <= list.size(); i++) {
            arr[i - 1] = list.get(i - 1);
        }
        return arr;

    }
}
